<template>
	<picker @change="pickerChange" @columnchange="columnChange" :value="index" :range="options" range-key="label"><slot></slot></picker>
</template>

<script>
export default {
	props: {
		options: {
			type: Array,
			default: () => {
				return [
					{
						label: '全部',
						value: 0
					},
					{
						label: '启用',
						value: 5
					},
					{
						label: '禁用',
						value: 4
					}
				];
			}
		}
	},
	data() {
		return {
			index: 0
		};
	},
	created() {
		// this.getList();
	},
	methods: {
		pickerChange(e) {
			const row = this.options[e.detail.value];
			this.$emit('pickerChange', row, e);
		},
		columnChange(e) {
			this.index = e.detail.value;
		}
	}
};
</script>

<style></style>
